/**
 * Copyright &copy; 2019-2022 <a href="https://gitee.com/rit/zx-pm">zx-pm</a> All rights reserved.
 */
package com.zx.pm.modules.zx.service;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import com.zx.pm.common.persistence.Page;
import com.zx.pm.common.service.CrudService;
import com.zx.pm.common.utils.StringUtils;
import com.zx.pm.modules.zx.entity.ProFiling;
import com.zx.pm.modules.zx.dao.LzdDao;
import com.zx.pm.modules.zx.dao.ProFilingDao;

/**
 * 项目归档Service
 * @author forest
 * @version 2019-02-19
 */
@Service
@Transactional(readOnly = true)
public class ProFilingService extends CrudService<ProFilingDao, ProFiling> {

	@Autowired
	private LzdDao lzdDao;
	
	public ProFiling get(String id) {
		return super.get(id);
	}
	
	public List<ProFiling> findList(ProFiling proFiling) {
		return super.findList(proFiling);
	}
	
	public Page<ProFiling> findPage(Page<ProFiling> page, ProFiling proFiling) {
		return super.findPage(page, proFiling);
	}
	
	@Transactional(readOnly = false)
	public void save(ProFiling proFiling) {
		if(StringUtils.isBlank(proFiling.getId())) {
			lzdDao.updateLzdStaut("4", proFiling.getLzdId());
		}
		
		super.save(proFiling);
	}
	
	@Transactional(readOnly = false)
	public void delete(ProFiling proFiling) {
		super.delete(proFiling);
	}
	
}